package hello

import "fmt"

func ForRange() {
	items := [...]string{"a", "b", "c", "d", "e"}
	fmt.Println("长度", len(items))
	for i, v := range items {
		fmt.Println(i, ":", v)
	}
}

func ArrayDouble(slice1 []int) []int {
	for i, item := range slice1 {
		slice1[i] = item * 2
	}

	return slice1
}

func Add(a ...int) int {
	fmt.Printf("%p", &a)
	fmt.Println()
	sum := 0
	for _, v := range a {
		sum += v
	}

	return sum
}
